#include "times_counter.h"



times_counter_c::
times_counter_c()
{
	count = 0;
}




times_counter_c::
~times_counter_c()
{}




bool
times_counter_c::
click(bool input, uint16_t times)
{
	if (input)
	{
		count++;
	}
	else
	{
		count = 0;
	}
		
	if (count >= times)
	{
		if (count > (5 * times))
		{
			count = 5 * times;
		}
		return true;
	}
	else
	{
		return false;
	}
}



void
times_counter_c::
reset(void)
{
	count = 0;
}


